<?php

namespace backend\controllers;

use backend\components\CRUDController;
use Yii;
use common\models\Category;
use backend\models\CategorySearch;
use yii\web\NotFoundHttpException;

/**
 * CategoryController implements the CRUD actions for Category model.
 */
class CategoryController extends CRUDController
{

    protected  function findModel($id = null,$search = false)
    {
        if($search){
            $model = new CategorySearch();
        }else if(empty($id)){
            $model = new Category();
        }else{
            if (($model = Category::findOne($id)) == null) {
                throw new NotFoundHttpException('The requested page does not exist.');
            }
        }
        return $model;
    }
    public function actionCeshi()
    {
      $ids = Yii::$app->request->getQueryParam('id');
      var_dump($ids);
    }

}
